﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Cores;
using BUSLayer;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        TaiKhoanBus tk = new TaiKhoanBus();
        string un = Login1.UserName.ToString();
        string pw = TaiKhoanBus.Encrypte(Login1.Password.ToString());
        int kq = tk.KTUser(un, pw);
        if (kq != 0)
        {
            Session["UserName"] = un;
           
            Session["IsLogin"] = 1;
            Session["MaKH"] = kq;
            Response.Redirect("~/FormHuyVe.aspx");
          
        }
        else
            Login1.FailureText = "Tài Khoản Không Hợp Lệ !";
    }
}
